package kr.co.doriclassic.forloop;

public class Sum1 {
	private int inpNum;
	private int sum=0;
	
	public Sum1(int inpNum) {
		this.inpNum = inpNum;		
	}
	
	public int sumCount(){
	
		for(int i=1;i<=inpNum;i++){
			sum+=i;
		}
		return sum;
	}

	@Override
	public String toString() {
		return "1에서 "+inpNum+"까지 합은" + sumCount() + "입니다.";
	}
	
}
